package com.cardone.common.template;

import java.io.Writer;

import lombok.extern.slf4j.Slf4j;
import freemarker.core.Environment;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;

/**
 * 模板异常处理
 *
 * @author yaohaitao
 *
 */
@Slf4j
public class FreemarkerExceptionHandler implements TemplateExceptionHandler {
	@Override
	public void handleTemplateException(final TemplateException te, final Environment env, final Writer out) throws TemplateException {
		FreemarkerExceptionHandler.log.error(te.getMessage(), te);
	}
}
